<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>摄影圈 - 个人信息</title>
    <link rel="stylesheet" href="/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="/css/new.css"/>
    <link rel="stylesheet" href="/css/user.css"/>
    <link rel="stylesheet" href="/css/gallery.css" />
    <script type="text/javascript" src="/js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="/js/bootstrap.min.js"></script>
</head>
<body>
<header>
    <% include header.ejs %>
</header>
<main>
    <div id="newsContain" style="width: 1000px;margin: 0 auto;margin-bottom: 20px">
        <div id="newContainerLoading">新闻内容正在加载中....</div>
    </div>
</main>
<% include footer.ejs %>

<script>
    //获取uniquekey
    var str=window.location.pathname;
    var index = str .lastIndexOf("\/");
    str  = str .substring(index + 1, str .length);
    console.log(str);
    //ajax
    $.ajax({
        "url": "http://newsapi.gugujiankong.com/Handler.ashx?action=getnewsitem&uniquekey="+str,
        "type": "get",
        "success": function (result) {
            $("#newContainerLoading").css("display","none");
            //把string转为json
            result = eval('('+result + ')');//通过eval转换成json对象
            //添加DOM
            $("#newsContain").html(result.pagecontent);
        }
    })
</script>
</body>
</html>